You can use multiple gateway for multiple sms template to send SMS.
It implement JS to user as per group
You can create record using GET or POST method of RESTfull API.
It fetch the history of a lead